using System;

using Microsoft.SPOT;

using mfRCF.Core;
using mfRCF.Core.Extensions;

using mfXmlSerializer;

using mfLogger;

using OST.Shared;
using OST.Commands.Extensions;

namespace OST.Commands
{

    /// <summary>
    /// returns the actual(/free) bytes in RAM, witch 'Debug.GC(...)'
    /// </summary>
    public class GCFreeBytesGETCommand : mfRcfCommand
    {
        #region CTOR

        public GCFreeBytesGETCommand(string httpPath)
            : base(httpPath, new mfGETMethod())
        {
        }

        #endregion

        #region mfRcfCommand
        public override void ExecuteCommand(mfIHttpContext httpContext)
        {
            try
            {
                this.WriteHttpResponseOK(httpContext, Debug.GC(true).ToString());
            }
            catch (Exception ex)
            {
                this.WriteHttpResponseError(httpContext, ex);
            }
        }

        #endregion
    }
}
